



/*
 * This class should be the root of your parse tree.
 * 
 * Update the class with the variables and constructors
 * you see required.
 * 
 * Update the toString method to print the tree.
 * 
 * Update the check method such that it checks the
 * tree for semantic errors.
 */

public class ClassDecl {

	String className;
	MethodsDecl methodDecls;

	public ClassDecl() {
	}

	public ClassDecl(String className, MethodsDecl methodDecls) {
		super();
		this.className = className;
		this.methodDecls = methodDecls;
	}

	public void check() throws SemanticException {
		if (methodDecls != null)
			methodDecls.check();
	}

	public String toString() {
		String ret = "ClassDecl\n";
		if (methodDecls != null) {
			String s = methodDecls.toString();
			for (String st : s.split("\n"))
				ret += "| " + st + "\n";
		}
		return ret;
	}
}
